home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7225 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: news.primenet.com!not-for-mail
  2. From: gbe@primenet.com (Gary Edstrom)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Programming problem with Borland C++ 3.1
  5. Date: 21 Feb 1996 22:49:04 -0700
  6. Organization: Sequoia Software
  7. Sender: root@primenet.com
  8. Message-ID: <312c0411.5136479@news.primenet.com>
  9. References: <312B40D9.3E66@scolaire.ucd.ie>
  10. X-Posted-By: ip233.lax.primenet.com
  11. X-Newsreader: Forte Agent .99d/32.182
  12.  
  13. The "operator =" function is a special function in C++.  It needs to be
  14. overridden in any derived class or else a simple member to member copy will be
  15. performed when assigning members of a derived class.  "Operator =" is NOT
  16. inherited into derived classes.
  17.  
  18. I hope this helps.
  19.  
  20. Gary Edstrom <gbe@primenet.com>
  21.  
  22. On Wed, 21 Feb 1996 15:57:13 +0000, you wrote:
  23.  
  24. >I'm doing a program about speech Recognition and I've run into a problem
  25. >that I'm not able to solve, because I simply don't understand it.
  26. >I wrote this code:
  27.  
  28. [snip]
  29.  
  30. >these two functions should do exactly the same job, as far as I know,
  31. >but they don't. why?
  32. >If I try and use the operator= (between two elements of the derived
  33. >class vectorArr) the program fails, and, by debugging, I discovered that
  34. >the compiler generates different codes not for the functions, but at the
  35. >point where the functions are called (they are not inlined).
  36. >Can any guru or half-guru help me?
  37.  
  38. --
  39. Gary Edstrom <gbe@primenet.com> | Sequoia Software
  40. PO Box 9573                     | Programming & Technical Services
  41. Glendale CA 91226-0573          | PGP Key ID: 0x1A0D44BD
  42. PGP Fingerprint: 72 AA 4F 73 05 53 89 C6  8A EE F4 EE D1 C0 13 8D 
  43.